package com.xinzhi.service.impl;

import com.xinzhi.domain.CarouselImg;
import com.xinzhi.mapper.CarouselImgMapper;
import com.xinzhi.service.CarouselImgService;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CarouselImgServiceImpl implements CarouselImgService {

    @Resource
    CarouselImgMapper carouselImgMapper;
    @Override
    public Result CarouselImg() {
        List<CarouselImg> carouselImgs = carouselImgMapper.carouselImgList();
        if (carouselImgs.size() == 0){
            return Result.error(50005, "管理员未上传轮播图");
        }
        return Result.ok(carouselImgs);
    }
}
